import React from 'react';
import { getAntd,getEcCom,getComsMobx } from '../../../util/convert';

/**
 * 指定流转condition
 * */
export default class Condition extends React.Component {
    constructor(){
        super();
        this.state = {
            date : new Date()
        }
    }
    render() {
        const {WeaSwitch} = getComsMobx();
        const {WeaErrorPage,WeaTools,WeaSearchGroup,WeaFormItem} = getEcCom();
        const {queryStore} = this.props;
        let {condition, form} = queryStore;
        let group = [];
        const formParams = form.getFormParams();
        form.isFormInit && condition.map(v => {
            let items = [];
            v.items.map((item,index) => {
                items.push({
                    com: (
                        <WeaFormItem
                            colon={false}
                            label={`${item.label}`}
                            labelCol={{span: `${item.labelcol}`}}
                            wrapperCol={{span: `${item.fieldcol}`}}>
                            <WeaSwitch fieldConfig={item} form={form}/>
                        </WeaFormItem>
                    )
                });
            });

            group.push(<WeaSearchGroup
                title={v.title}
                className={"wf-form-changeFlow-group"}
                needTigger={true}
                showGroup={v.defaultshow}
                items={items}
                col={1}
            />);
        });

        return (
            <div>{group}</div>
        )
    }
}
